package com.design.config;
import com.design.util.Console;
import java.io.File;


public class GameFile {
    private final static String rootPath = "static/";
    private static final String PICTURE_DIR = rootPath + "images/";//图片目录
    public static final String MAP_DIR = rootPath + "map/";//地图目录
    public static final String MAP_LOG_DIR = rootPath + "log/";//游戏日志目录
    public static final String MUSIC_DIR = rootPath + "music/";//音乐目录

    public static final String CREATE_MAP_FILE = rootPath + "create";//创建地图日志文件
    public static final String IMG_PLAYER  = PICTURE_DIR + "player.png";
    public static final String IMG_WALL =PICTURE_DIR + "wall.png";
    public static final String IMG_BOX = PICTURE_DIR + "box.png";
    public static final String IMG_POINT = PICTURE_DIR + "point.png";
    public static final String IMG_BOX_IN_POINT = PICTURE_DIR + "boxInPoint.png";
    public static final String IMG_GROUND = PICTURE_DIR + "ground.png";
    private static void createDir(String path){
        File file = new File(path);
        if(!file.isDirectory()){
            Console.log("创建目录 " + file.getAbsolutePath() + (file.mkdir() ? "成功" : "失败"));
        }
    }
    public static void initial(){
        createDir(rootPath);
        createDir(PICTURE_DIR);
        createDir(MAP_DIR);
        createDir(MAP_LOG_DIR);
        createDir(MUSIC_DIR);
    }
}
